package java2_unit5_1015;

import java.util.Scanner;

public class PetTest {
	public static void main(String[] args) {
		/*
		 * 让用户输入选择---scanner
		 *需要调用主人的方法 ---主人对象
		 *先提示选则宠物；
		 *然后给宠物各属性赋值；
		 *诊断治疗或者喂食物？
		 */
		Scanner scanner = new Scanner(System.in);
		Master master = new Master();
		
		System.out.println("欢迎访问电子宠物系统！");
		System.out.println("请选择宠物种类：\n1.狗狗\t2.猫咪");
		int petType = scanner.nextInt();
		if(petType==1) {
			System.out.println("您选择了宠物狗！");
			Dog dog = new Dog();
			System.out.print("请输入宠物狗的昵称：");
			dog.setName(scanner.next());
			System.out.println("请输入宠物狗的性别：\n1.雄性\t2.雌性");
			int sexInt=scanner.nextInt();
			dog.setSex(sexInt==1?"雄性":"雌性");
			System.out.print("请输入宠物狗的健康值(1-100之间)：");
			dog.setHealth(scanner.nextInt());
			System.out.print("请输入宠物狗与主人之间的亲密度(1-10之间)：");
			dog.setLove(scanner.nextInt());
			master.cure(dog);
			master.feed(dog);
			
		}else {
			System.out.println("您选择了宠物猫！");
			Cat cat = new Cat();
			System.out.print("请输入宠物猫的昵称：");
			cat.setName(scanner.next());
			System.out.print("请输入宠物猫的性别：\n1.雄性\t2.雌性");
			int sexInt=scanner.nextInt();
			cat.setSex(sexInt==1?"雄性":"雌性");
			System.out.print("请输入宠物猫的健康值(1-100之间)：");
			cat.setHealth(scanner.nextInt());
			System.out.print("请输入宠物猫的懒度(1-10之间)：");
			cat.setLazy(scanner.nextInt());
			master.cure(cat);
			master.feed(cat);
		}
		
		
		
		
	}
}
